Repository navigation
Game Boost validation on Intel hybrid (i9-12900K) and fixes - #134
Conversation
Windows 10 1703+ and Windows 11 keep Game Mode on by default and only write HKCU\Software\Microsoft\GameBar\AutoGameModeEnabled after the user flips the switch. The Optimizations page read a missing key or value as 'disabled', so it contradicted Windows on a clean install. Only an explicit 0 now means off; unreadable values report the Windows default.
ServiceConfiguration registers no ILogger provider, so everything services log through ILogger, including Game Boost session start, end, skips and restores, never reached ThreadPilot.log; the Activity page only keeps the current run in memory. Activity entries are now also written to the log file as System events (one line per entry, so the volume stays what the Activity page shows), which makes a past Game Boost session readable after a restart.
Selecting a game during a Game Boost session showed 'Current CPU Sets: CPU 0..15' in English with no hint of where they came from, next to a status line that still printed the full OS affinity, so a boosted game looked untouched. The line is now localized and names the source: Game Boost (from its journal, via IGameSessionService.HasAppliedCpuSets), the user's saved rule, or anything else. A process without CPU Sets says that Windows picks its cores.
A foreground game whose executable path cannot be read (protected or anti-cheat processes can hide it) never matches the game-library check, so Game Boost silently did nothing. It is now reported once per process in Activity with the manual-list workaround. A failing Game Boost tick is also reported once per distinct error instead of only going to ILogger, which has no provider.
The 12900K case is the CPU Set table read with GetSystemCpuSetInformation on real hardware (24 CPU Sets, IDs 256-279, class 1 on LP 0-15, class 0 on LP 16-23, one L3). The 13th/14th gen, i5-12400, Core Ultra and Lunar Lake cases are synthetic and pin down what the policy decides, including that with three efficiency classes only the top one counts as P-cores.
ProcessService took ExecutablePath from Process.MainModule, which opens the process for PROCESS_VM_READ and walks its module list. BattlEye refuses that right, so Arma Reforger (ArmaReforgerSteam.exe) had no path, never matched the game-library check and Game Boost silently did nothing for it, even though the same process accepts CPU Sets and QoS changes. The path now comes from QueryFullProcessImageName with only PROCESS_QUERY_LIMITED_INFORMATION, the right Task Manager uses, with MainModule kept as the fallback. Verified on a real i9-12900K: Arma Reforger is detected and confined to the P-cores without a manual entry.
With the CPU Sets source appended, the line for a game confined to 16 CPUs no longer fits the side panel and was cut mid-word.
Results of a validation session on a real Alder Lake CPU: what was read from Windows for each check (topology, CPU Sets, restore, dynamic release timings, real games), the causes found for the reported problems, the fixes on this branch, and what is only inferred for 13th/ 14th gen and Core Ultra.
Process.MainWindowHandle runs its own EnumWindows over the whole desktop for every process, so each refresh of the process list cost processes x windows. The list refresh now takes one snapshot with the same rule as .NET's MainWindowFinder (first visible, unowned top-level window in Z order) and reads titles only for processes that have a window. Measured on 153 processes: ~2 ms of window lookups per refresh down to ~0.02 ms. Single-process refreshes keep using Process.MainWindowHandle.
ThreadPilot always runs elevated. When OpenProcess grants the handle and the call made with it then fails with ERROR_ACCESS_DENIED, a kernel callback (anti-cheat, anti-tamper) stripped the rights; telling the user the process 'may require administrator rights' sent them the wrong way. CPU Set and efficiency/memory priority failures in that situation are now flagged IsAntiCheatLikely with the existing 'will not try to bypass it' message; a refused OpenProcess keeps the plain access-denied message. Game Boost's Activity line for a refused QoS change now carries the reason instead of 'efficiency mode not applied'. Seen on Call of Duty (Ricochet): handles open, SetProcessDefaultCpuSets returns 5.
Measured background cost (event-driven monitoring already below 0.1 % of one core minimized, Game Boost tick not measurable), window-open and hidden-after-open costs, memory of the single-file publish, startup timeline, Assetto Corsa Competizione rule/priority behaviour, and the design ThreadPilot follows for anti-cheat-protected games: least rights, classify instead of retry, legitimate fallbacks (background moves, IFEO launch priority), no SYSTEM service and no bypass techniques.
The saved priority was verified at +1 s and +3 s only. On a real run Assetto Corsa Competizione put itself back to Normal within about a minute of starting, after both checks had passed, so the rule silently stopped applying. A late check at +90 s now logs the revert and uses the same single retry as the early checks; a process that has exited by then is skipped without an Activity entry. Still a fixed number of checks, no polling.
WindowsCpuTopologyProvider never fills in CpuTopologySignature.CpuBrand, so it is always 'Unknown'. A rule or mask saved with a real brand (a hand-edited file, an import) was therefore reported on the Rules page as pinning cores 'from a different CPU' on the very CPU it was made for. The brand now counts only when both sides have one; core counts, group count and the processor list still flag a real CPU change. The warning text is localized.
Under 'Cores' the editor had an unlabeled, empty combo box that opened the saved CPU masks, which read as a broken control. It now has a label saying it is a CPU mask preset whose cores are applied with the mode chosen above (CPU Sets, affinity mask or ideal processor), and shows 'Keep the current cores' until a mask is picked. The editor scrolls instead of cutting off the Save button on short windows. Strings in all seven languages.
At 1280 x 864 the Rules editor and other pages were cut off. The default height is now 960; a saved size of exactly the old default (never resized by the user) moves to the new one, and placement correction still shrinks the window to the screen's working area on smaller displays.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8b415823c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tick The failure message was remembered to avoid repeating it every 3 s but never cleared, so an error that came back after a recovery was never shown in Activity again.
What this is
Validation and fixes for Game Boost from a session on a real Intel Core i9-12900K (Alder Lake, 8P+8E), plus a background-cost audit. Full write-up:
docs/validation/intel-hybrid-12900k.md,docs/validation/performance-audit-12900k.md,docs/design/protected-processes.md.Fixes
MainModule, which needsPROCESS_VM_READ. NowQueryFullProcessImageNamewithPROCESS_QUERY_LIMITED_INFORMATION.AutoGameModeEnabled(or the key) is missing; Windows 11 defaults to on. Only an explicit 0 means off.ThreadPilot.log; Game Boost reports skipped games (unreadable path) and failed checks.EnumWindowspass per process-list refresh; main window opens 960 px tall.Evidence and limits